load("@fbcode_macros//build_defs:build_file_migration.bzl", "fbcode_target", "non_fbcode_target")
load("@fbcode_macros//build_defs:cpp_benchmark.bzl", "cpp_benchmark")
load("@fbcode_macros//build_defs:cpp_library.bzl", "cpp_library")
load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")
load("@fbsource//tools/build_defs:default_platform_defs.bzl", "ANDROID", "APPLE", "CXX", "WINDOWS")
load("../../defs.bzl", "CXXFLAGS", "FBANDROID_CPPFLAGS", "FBANDROID_CXXFLAGS", "FBOBJC_CXXFLAGS", "folly_xplat_cxx_test")

oncall("fbcode_entropy_wardens_folly")

# xplat build rules

non_fbcode_target(
    _kind = folly_xplat_cxx_test,
    name = "test",
    srcs = [
        "BarrierTest.cpp",
        "ContextTest.cpp",
        "CoreTest.cpp",
        "EnsureTest.cpp",
        "FilterTest.cpp",
        "HeaderCompileTest.cpp",
        "MapTest.cpp",
        "NonCopyableLambdaTest.cpp",
        "PollTest.cpp",
        "PromiseTest.cpp",
        "ReduceTest.cpp",
        "SelfDestructTest.cpp",
        "SharedPromiseTest.cpp",
        "TestExecutor.cpp",
        "ThenCompileTest.cpp",
        "ThenTest.cpp",
        "TimesTest.cpp",
        "UnwrapTest.cpp",
        "ViaTest.cpp",
        "WhenTest.cpp",
        "WhileDoTest.cpp",
        "WillEqualTest.cpp",
    ],
    compiler_flags = CXXFLAGS + select({
        "DEFAULT": [],
        "ovr_config//os:android": FBANDROID_CXXFLAGS + [
            "-Wno-deprecated-declarations",
        ],
    }),
    # TODO(T188948036): Fix xplat/folly/futures/test:test & folly_xplat_cxx_test
    # The arguments below are unused by folly_xplat_cxx_test.
    # They need to be investigated and fixed (i.e., correctly used or removed).
    cxx_srcs = [
        "FutureTest.cpp",
        "InterruptTest.cpp",
        "TimekeeperTest.cpp",
        "WaitTest.cpp",
        "WindowTest.cpp",
    ],
    fbobjc_compiler_flags = FBOBJC_CXXFLAGS,
    fbobjc_srcs = [
        "FutureTest.cpp",
        "InterruptTest.cpp",
        "TimekeeperTest.cpp",
        "WaitTest.cpp",
        "WindowTest.cpp",
    ],
    include_directories = [
        "../..",
    ],
    platforms = (ANDROID, APPLE, CXX, WINDOWS),
    preprocessor_flags = select({
        "DEFAULT": [],
        "ovr_config//os:linux": FBANDROID_CPPFLAGS,
    }),
    raw_headers = [
        "TestExecutor.h",
        "ThenCompileTest.h",
    ],
    use_instrumentation_test = True,
    deps = [
        "fbsource//third-party/boost:boost",
        "fbsource//third-party/boost:boost_filesystem",
        "fbsource//third-party/boost:boost_system",
        "fbsource//third-party/double-conversion:double-conversion",
        "fbsource//third-party/glog:glog",
        "fbsource//xplat/folly:atomic_hash_map",
        "fbsource//xplat/folly:atomic_linked_list",
        "fbsource//xplat/folly:c_portability",
        "fbsource//xplat/folly:chrono",
        "fbsource//xplat/folly:config",
        "fbsource//xplat/folly:constexpr_math",
        "fbsource//xplat/folly:conv",
        "fbsource//xplat/folly:cpp_attributes",
        "fbsource//xplat/folly:demangle",
        "fbsource//xplat/folly:discriminated_ptr",
        "fbsource//xplat/folly:dynamic",
        "fbsource//xplat/folly:exception",
        "fbsource//xplat/folly:exception_string",
        "fbsource//xplat/folly:executor",
        "fbsource//xplat/folly:expected",
        "fbsource//xplat/folly:fbstring",
        "fbsource//xplat/folly:fbvector",
        "fbsource//xplat/folly:file",
        "fbsource//xplat/folly:format",
        "fbsource//xplat/folly:format_traits",
        "fbsource//xplat/folly:function",
        "fbsource//xplat/folly:glog",
        "fbsource//xplat/folly:indestructible",
        "fbsource//xplat/folly:indexed_mem_pool",
        "fbsource//xplat/folly:intrusive_list",
        "fbsource//xplat/folly:likely",
        "fbsource//xplat/folly:math",
        "fbsource//xplat/folly:memory",
        "fbsource//xplat/folly:micro_lock",
        "fbsource//xplat/folly:move_wrapper",
        "fbsource//xplat/folly:mpmc_queue",
        "fbsource//xplat/folly:observer_container",
        "fbsource//xplat/folly:optional",
        "fbsource//xplat/folly:overload",
        "fbsource//xplat/folly:portability",
        "fbsource//xplat/folly:preprocessor",
        "fbsource//xplat/folly:random",
        "fbsource//xplat/folly:range",
        "fbsource//xplat/folly:scope_guard",
        "fbsource//xplat/folly:shared_mutex",
        "fbsource//xplat/folly:singleton",
        "fbsource//xplat/folly:singleton_thread_local",
        "fbsource//xplat/folly:small_vector",
        "fbsource//xplat/folly:sorted_vector_types",
        "fbsource//xplat/folly:spin_lock",
        "fbsource//xplat/folly:stop_watch",
        "fbsource//xplat/folly:synchronized",
        "fbsource//xplat/folly:thread_local",
        "fbsource//xplat/folly:traits",
        "fbsource//xplat/folly:unit",
        "fbsource//xplat/folly/concurrency:cache_locality",
        "fbsource//xplat/folly/concurrency:concurrent_hash_map",
        "fbsource//xplat/folly/concurrency:priority_unbounded_queue_set",
        "fbsource//xplat/folly/concurrency:unbounded_queue",
        "fbsource//xplat/folly/container:array",
        "fbsource//xplat/folly/container:bit_iterator",
        "fbsource//xplat/folly/container:enumerate",
        "fbsource//xplat/folly/container:evicting_cache_map",
        "fbsource//xplat/folly/container:f14_hash",
        "fbsource//xplat/folly/container:foreach",
        "fbsource//xplat/folly/container:heap_vector_types",
        "fbsource//xplat/folly/container:iterator",
        "fbsource//xplat/folly/container:sparse_byte_set",
        "fbsource//xplat/folly/detail:discriminated_ptr_detail",
        "fbsource//xplat/folly/detail:futex",
        "fbsource//xplat/folly/detail:socket_fast_open",
        "fbsource//xplat/folly/detail:turn_sequencer",
        "fbsource//xplat/folly/executors:cpu_thread_pool_executor",
        "fbsource//xplat/folly/executors:global_executor",
        "fbsource//xplat/folly/executors:inline_executor",
        "fbsource//xplat/folly/executors:io_thread_pool_executor",
        "fbsource//xplat/folly/executors:serial_executor",
        "fbsource//xplat/folly/executors/task_queue:priority_lifo_sem_mpmc_queue",
        "fbsource//xplat/folly/executors/task_queue:priority_unbounded_blocking_queue",
        "fbsource//xplat/folly/executors/task_queue:unbounded_blocking_queue",
        "fbsource//xplat/folly/fibers:core",
        "fbsource//xplat/folly/fibers:event_base_loop_controller",
        "fbsource//xplat/folly/fibers:fiber_manager_map",
        "fbsource//xplat/folly/functional:apply_tuple",
        "fbsource//xplat/folly/functional:invoke",
        "fbsource//xplat/folly/functional:partial",
        "fbsource//xplat/folly/io:iobuf",
        "fbsource//xplat/folly/io:typed_io_buf",
        "fbsource//xplat/folly/io/async:async_base",
        "fbsource//xplat/folly/io/async:async_pipe",
        "fbsource//xplat/folly/io/async:async_signal_handler",
        "fbsource//xplat/folly/io/async:async_socket",
        "fbsource//xplat/folly/io/async:async_socket_base",
        "fbsource//xplat/folly/io/async:async_socket_exception",
        "fbsource//xplat/folly/io/async:async_ssl_socket",
        "fbsource//xplat/folly/io/async:async_transport",
        "fbsource//xplat/folly/io/async:async_transport_certificate",
        "fbsource//xplat/folly/io/async:async_udp_server_socket",
        "fbsource//xplat/folly/io/async:async_udp_socket",
        "fbsource//xplat/folly/io/async:decorated_async_transport_wrapper",
        "fbsource//xplat/folly/io/async:destructor_check",
        "fbsource//xplat/folly/io/async:scoped_event_base_thread",
        "fbsource//xplat/folly/io/async:server_socket",
        "fbsource//xplat/folly/io/async:ssl_context",
        "fbsource//xplat/folly/io/async:ssl_options",
        "fbsource//xplat/folly/io/async/ssl:basic_transport_certificate",
        "fbsource//xplat/folly/io/async/ssl:openssl_utils",
        "fbsource//xplat/folly/io/async/ssl:ssl_errors",
        "fbsource//xplat/folly/io/async/ssl:tls_definitions",
        "fbsource//xplat/folly/lang:bits",
        "fbsource//xplat/folly/lang:checked_math",
        "fbsource//xplat/folly/lang:exception",
        "fbsource//xplat/folly/lang:rvalue_reference_wrapper",
        "fbsource//xplat/folly/lang:uncaught_exceptions",
        "fbsource//xplat/folly/logging:init",
        "fbsource//xplat/folly/logging:init_weak",
        "fbsource//xplat/folly/logging:log_handler",
        "fbsource//xplat/folly/logging:log_level",
        "fbsource//xplat/folly/logging:log_name",
        "fbsource//xplat/folly/logging:logging",
        "fbsource//xplat/folly/logging:rate_limiter",
        "fbsource//xplat/folly/memory:arena",
        "fbsource//xplat/folly/memory:malloc",
        "fbsource//xplat/folly/net:tcpinfo",
        "fbsource//xplat/folly/net:tcpinfo_dispatcher",
        "fbsource//xplat/folly/portability:asm",
        "fbsource//xplat/folly/portability:atomic",
        "fbsource//xplat/folly/portability:builtins",
        "fbsource//xplat/folly/portability:dirent",
        "fbsource//xplat/folly/portability:event",
        "fbsource//xplat/folly/portability:fcntl",
        "fbsource//xplat/folly/portability:gflags",
        "fbsource//xplat/folly/portability:gmock",
        "fbsource//xplat/folly/portability:gtest",
        "fbsource//xplat/folly/portability:iovec",
        "fbsource//xplat/folly/portability:math",
        "fbsource//xplat/folly/portability:openssl",
        "fbsource//xplat/folly/portability:pthread",
        "fbsource//xplat/folly/portability:stdlib",
        "fbsource//xplat/folly/portability:sys_mman",
        "fbsource//xplat/folly/portability:sys_resource",
        "fbsource//xplat/folly/portability:sys_stat",
        "fbsource//xplat/folly/portability:sys_syscall",
        "fbsource//xplat/folly/portability:sys_time",
        "fbsource//xplat/folly/portability:syslog",
        "fbsource//xplat/folly/portability:time",
        "fbsource//xplat/folly/portability:windows",
        "fbsource//xplat/folly/ssl:openssl_cert_utils",
        "fbsource//xplat/folly/ssl:openssl_hash",
        "fbsource//xplat/folly/ssl:openssl_ptr_types",
        "fbsource//xplat/folly/ssl:ssl_session",
        "fbsource//xplat/folly/ssl:ssl_session_manager",
        "fbsource//xplat/folly/synchronization:call_once",
        "fbsource//xplat/folly/synchronization:hazptr",
        "fbsource//xplat/folly/synchronization:lifo_sem",
        "fbsource//xplat/folly/synchronization:micro_spin_lock",
        "fbsource//xplat/folly/synchronization:pico_spin_lock",
        "fbsource//xplat/folly/synchronization:rcu",
        "fbsource//xplat/folly/synchronization:small_locks",
        "fbsource//xplat/folly/system:thread_id",
        "fbsource//xplat/folly/system:thread_name",
        "fbsource//xplat/folly/tracing:scoped_trace_section",
        "fbsource//xplat/folly/tracing:static_tracepoint",
        "fbsource//xplat/third-party/event:event",
        "fbsource//xplat/third-party/linker_lib:atomic",
        "fbsource//xplat/third-party/openssl:crypto",
        "fbsource//xplat/third-party/openssl:ssl",
        "//third-party/boost:boost",
        "//third-party/boost:boost_system",
        "//third-party/boost:boost_thread",
        "//third-party/double-conversion:double-conversion",
        "//third-party/glog:glog",
        "//third-party/googletest:gtest_main",
        "//xplat/folly:atomic_hash_map",
        "//xplat/folly:atomic_linked_list",
        "//xplat/folly:c_portability",
        "//xplat/folly:config",
        "//xplat/folly:constexpr_math",
        "//xplat/folly:conv",
        "//xplat/folly:cpp_attributes",
        "//xplat/folly:demangle",
        "//xplat/folly:dynamic",
        "//xplat/folly:exception",
        "//xplat/folly:exception_string",
        "//xplat/folly:executor",
        "//xplat/folly:expected",
        "//xplat/folly:fbstring",
        "//xplat/folly:fbvector",
        "//xplat/folly:file",
        "//xplat/folly:format",
        "//xplat/folly:format_traits",
        "//xplat/folly:function",
        "//xplat/folly:futures",
        "//xplat/folly:glog",
        "//xplat/folly:indestructible",
        "//xplat/folly:intrusive_list",
        "//xplat/folly:likely",
        "//xplat/folly:math",
        "//xplat/folly:memory",
        "//xplat/folly:micro_lock",
        "//xplat/folly:move_wrapper",
        "//xplat/folly:optional",
        "//xplat/folly:overload",
        "//xplat/folly:portability",
        "//xplat/folly:preprocessor",
        "//xplat/folly:range",
        "//xplat/folly:scope_guard",
        "//xplat/folly:shared_mutex",
        "//xplat/folly:singleton_thread_local",
        "//xplat/folly:small_vector",
        "//xplat/folly:sorted_vector_types",
        "//xplat/folly:spin_lock",
        "//xplat/folly:test-headers",
        "//xplat/folly:thread_local",
        "//xplat/folly:traits",
        "//xplat/folly:unit",
        "//xplat/folly/concurrency:cache_locality",
        "//xplat/folly/container:array",
        "//xplat/folly/container:enumerate",
        "//xplat/folly/container:foreach",
        "//xplat/folly/container:heap_vector_types",
        "//xplat/folly/container:iterator",
        "//xplat/folly/container:sparse_byte_set",
        "//xplat/folly/detail:futex",
        "//xplat/folly/functional:apply_tuple",
        "//xplat/folly/functional:invoke",
        "//xplat/folly/functional:partial",
        "//xplat/folly/io:iobuf",
        "//xplat/folly/lang:bits",
        "//xplat/folly/lang:checked_math",
        "//xplat/folly/lang:exception",
        "//xplat/folly/lang:rvalue_reference_wrapper",
        "//xplat/folly/lang:uncaught_exceptions",
        "//xplat/folly/memory:arena",
        "//xplat/folly/memory:malloc",
        "//xplat/folly/system:thread_id",
        "//xplat/folly/system:thread_name",
        "//xplat/folly/test/common:test_main",
    ],
)

# fbcode build rules

fbcode_target(
    _kind = cpp_unittest,
    name = "barrier_test",
    srcs = ["BarrierTest.cpp"],
    deps = [
        "//folly:random",
        "//folly/futures:barrier",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "callback_lifetime_test",
    srcs = ["CallbackLifetimeTest.cpp"],
    deps = [
        ":test_executor",
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "collect_test",
    srcs = ["CollectTest.cpp"],
    deps = [
        "//folly:default_keep_alive_executor",
        "//folly:random",
        "//folly:small_vector",
        "//folly/executors:cpu_thread_pool_executor",
        "//folly/executors:manual_executor",
        "//folly/futures:core",
        "//folly/portability:gtest",
        "//folly/synchronization:baton",
    ],
    external_deps = [
        ("boost", None, "boost_thread"),
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "context_test",
    srcs = ["ContextTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "core_test",
    srcs = ["CoreTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/futures/detail:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "ensure_test",
    srcs = ["EnsureTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "filter_test",
    srcs = ["FilterTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "future_splitter_test",
    srcs = ["FutureSplitterTest.cpp"],
    deps = [
        "//folly/executors:manual_executor",
        "//folly/futures:future_splitter",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "future_test",
    srcs = ["FutureTest.cpp"],
    deps = [
        "//folly:executor",
        "//folly:memory",
        "//folly:unit",
        "//folly/executors:manual_executor",
        "//folly/futures:core",
        "//folly/json:dynamic",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
        "//folly/synchronization:baton",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "semi_future_test",
    srcs = ["SemiFutureTest.cpp"],
    deps = [
        "//folly:executor",
        "//folly:memory",
        "//folly:unit",
        "//folly/executors:manual_executor",
        "//folly/futures:core",
        "//folly/io/async:async_base",
        "//folly/json:dynamic",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
        "//folly/synchronization:baton",
    ],
)

fbcode_target(
    _kind = cpp_benchmark,
    name = "futures_benchmark",
    srcs = ["Benchmark.cpp"],
    headers = [],
    args = [
        "--json",
    ],
    deps = [
        ":test_executor",
        "//folly:benchmark",
        "//folly/executors:inline_executor",
        "//folly/futures:core",
        "//folly/portability:gflags",
        "//folly/synchronization:baton",
        "//folly/synchronization:native_semaphore",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "header_compile_test",
    srcs = ["HeaderCompileTest.cpp"],
    deps = [
        "//folly:try",
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "interrupt_test",
    srcs = ["InterruptTest.cpp"],
    labels = ["load-sensitive-timing-test"],
    deps = [
        ":test_executor",
        "//folly/futures:core",
        "//folly/portability:gtest",
        "//folly/synchronization:baton",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "manual_timekeeper_test",
    srcs = ["ManualTimekeeperTest.cpp"],
    deps = [
        "//folly/futures:manual_timekeeper",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "map_test",
    srcs = ["MapTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "non_copyable_lambda_test",
    srcs = ["NonCopyableLambdaTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "poll_test",
    srcs = ["PollTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "promise_test",
    srcs = ["PromiseTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "reduce_test",
    srcs = ["ReduceTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "retrying_test",
    srcs = ["RetryingTest.cpp"],
    deps = [
        ":test_executor",
        "//folly/futures:core",
        "//folly/portability:gtest",
        "//folly/portability:sys_resource",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "self_destruct_test",
    srcs = ["SelfDestructTest.cpp"],
    deps = [
        "//folly/executors:inline_executor",
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "shared_promise_test",
    srcs = ["SharedPromiseTest.cpp"],
    deps = [
        "//folly/futures:shared_promise",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "test_executor",
    srcs = ["TestExecutor.cpp"],
    headers = ["TestExecutor.h"],
    exported_deps = [
        "//folly:executor",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "test_executor_test",
    srcs = ["TestExecutorTest.cpp"],
    deps = [
        ":test_executor",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "then_compile_test",
    srcs = ["ThenCompileTest.cpp"],
    headers = ["ThenCompileTest.h"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "then_test",
    srcs = ["ThenTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "timekeeper_test",
    srcs = ["TimekeeperTest.cpp"],
    deps = [
        "//folly:singleton",
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_library,
    name = "timekeeper_test_lib",
    headers = ["TimekeeperTestLib.h"],
    exported_deps = [
        "fbsource//third-party/fmt:fmt",
        "//folly:default_keep_alive_executor",
        "//folly:random",
        "//folly:singleton",
        "//folly/executors:global_executor",
        "//folly/executors:manual_executor",
        "//folly/executors:serial_executor",
        "//folly/executors:virtual_executor",
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
    exported_external_deps = [
        "glog",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "thread_wheel_timekeeper_test",
    srcs = ["ThreadWheelTimekeeperTest.cpp"],
    supports_static_listing = False,
    deps = [
        ":timekeeper_test_lib",
        "//folly/futures:core",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "heap_timekeeper_test",
    srcs = ["HeapTimekeeperTest.cpp"],
    supports_static_listing = False,
    deps = [
        ":timekeeper_test_lib",
        "//folly/futures:core",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "times_test",
    srcs = ["TimesTest.cpp"],
    deps = [
        "//folly/executors:manual_executor",
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "unwrap_test",
    srcs = ["UnwrapTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "via_test",
    srcs = ["ViaTest.cpp"],
    deps = [
        "//folly:mpmc_queue",
        "//folly/executors:drivable_executor",
        "//folly/executors:inline_executor",
        "//folly/executors:manual_executor",
        "//folly/futures:core",
        "//folly/portability:gtest",
        "//folly/synchronization:baton",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "wait_test",
    srcs = ["WaitTest.cpp"],
    deps = [
        ":test_executor",
        "//folly/executors:inline_executor",
        "//folly/futures:core",
        "//folly/io/async:async_base",
        "//folly/portability:gtest",
        "//folly/synchronization:baton",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "when_test",
    srcs = ["WhenTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "while_do_test",
    srcs = ["WhileDoTest.cpp"],
    deps = [
        "//folly/executors:manual_executor",
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "will_equal_test",
    srcs = ["WillEqualTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "window_test",
    srcs = ["WindowTest.cpp"],
    deps = [
        "//folly:conv",
        "//folly/executors:manual_executor",
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
    external_deps = [
        ("boost", None, "boost_thread"),
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "conversion_operator",
    srcs = ["ConversionOperatorTest.cpp"],
    deps = [
        "//folly/futures:core",
        "//folly/portability:gtest",
    ],
)

fbcode_target(
    _kind = cpp_unittest,
    name = "cleanup_test",
    srcs = ["CleanupTest.cpp"],
    headers = [],
    labels = ["case-isolation-failure"],
    deps = [
        "//folly/executors:cpu_thread_pool_executor",
        "//folly/executors:manual_executor",
        "//folly/futures:cleanup",
        "//folly/portability:gtest",
    ],
)
